package com.powergisol.gis.service.impl;

import com.powergisol.gis.service.FallBackService;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * Date: 2019/8/7  14:53
 * Description:
 */
@Component
public class FallBackServiceImpl implements FallBackService {
    private static Logger logger = LoggerFactory.getLogger(FallBackServiceImpl.class);
    @Override
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds",value = "3000")
    })
    public String getLayer(String name,String fileUrl, String styleUrl, String encodingType) {
        logger.error("获取服务属性失败：{}",name);
        return null;
    }

    @Override
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds",value = "3000")
    })
    public String getLayerTable(String name,String fileUrl, String styleUrl, String encodingType) {
        logger.error("获取layerTable失败：{}",name);
        return null;
    }

    @Override
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds",value = "3000")
    })
    public String getLayerTableData(String name, Integer index,String fileUrl, String styleUrl, String encodingType) {
        logger.error("获取layerTable index失败：{}",name);
        return null;
    }

    @Override
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds",value = "3000")
    })
    public String getLayerType(String fileUrl, String encodingType) {
        return null;
    }

    @Override
    @HystrixCommand(commandProperties = {
            @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds",value = "3000")
    })
    public String getLayerTableDetail(int row, String name, String fileUrl, String styleUrl, String encodingType) {
        return null;
    }
}
